
import { _decorator, macro } from "cc";
import { EcsRoleSystem } from "./game/role/EcsRoleSystem";
import { Root } from "../../extensions/oops-plugin-framework/assets/core/Root";
import { oops } from "../../extensions/oops-plugin-framework/assets/core/Oops";
import { smc } from "./game/common/ecs/SingletonModuleComp";
import { ecs } from "db://oops-framework/libs/ecs/ECS";
import { EcsInitializeSystem, Initialize } from "./game/initialize/Initialize";
import { Account } from "./game/account/Account";
import { EcsAccountSystem } from "./game/account/EcsAccountSystem";
import { UIConfigData } from "./game/common/config/GameUIConfig";
import { Scene } from "./game/battle/scene/Scene";
import { EcsSceneSystem } from "./game/battle/scene/EcsSceneSystem";
import { EcsLeaderSystem } from "./game/leader/Leader";
import { EcsPlayerInfoSystem, PlayerInfo } from "./gui/menu/playerInfo/PlayerInfo";
import { Book, EcsBookSystem } from "./gui/book/Book";
import { EcsItemSystem } from "./game/item/Item";
import { LogType } from "db://oops-framework/core/common/log/Logger";
import { EcsSkillSystem } from "./game/battle/skill/Skill";
import { EcsBuffSystem } from "./game/battle/buff/Buff";
import { EcsEquipSystem } from "./game/equip/Equip";
const { ccclass, property } = _decorator;

@ccclass('Main')
export class Main extends Root {
   start() {
      //是否开启多点触摸
      macro.ENABLE_MULTI_TOUCH = false;
      oops.log.setTags(LogType.View|LogType.Business|LogType.Model|LogType.Net|LogType.Config|LogType.Trace)
   }
   protected run() {
      smc.initialize = ecs.getEntity<Initialize>(Initialize);
      smc.account = ecs.getEntity<Account>(Account);
      smc.scene = ecs.getEntity<Scene>(Scene);
      smc.book = ecs.getEntity<Book>(Book);
      smc.playerInfo = ecs.getEntity<PlayerInfo>(PlayerInfo);
   }
   protected initGui() {
      oops.gui.init(UIConfigData);
  }
   /** 初始化游戏业务模块 */
   protected initEcsSystem() {
      oops.ecs.add(new EcsInitializeSystem());
      oops.ecs.add(new EcsAccountSystem());
      oops.ecs.add(new EcsSceneSystem());
      oops.ecs.add(new EcsRoleSystem());
      oops.ecs.add(new EcsLeaderSystem());
      oops.ecs.add(new EcsPlayerInfoSystem());
      oops.ecs.add(new EcsBookSystem());
      oops.ecs.add(new EcsItemSystem());
      oops.ecs.add(new EcsSkillSystem());
      oops.ecs.add(new EcsBuffSystem());
      oops.ecs.add(new EcsEquipSystem());
   }




}